package com.yan.project.controller;

import com.yan.core.annotations.YanAutowired;
import com.yan.core.annotations.YanController;
import com.yan.core.annotations.YanRequestMapping;
import com.yan.core.annotations.YanSecurity;
import com.yan.project.service.IDemoService;

/**
 * TODO
 *
 * @Author: 汪焰
 * @Date: 2020/12/7 22:26
 */
@YanController
@YanRequestMapping("/demo")
public class DemoController {

    @YanAutowired
    private IDemoService demoService;

    /**
     * localhost:8080/demo/index
     */
    @YanRequestMapping("/index")
    public String index(String name) {
        System.out.println("------DemoController------index--------");
        return demoService.getName(name);
    }

    /**
     * localhost:8080/demo/index1?name=wy
     */
    @YanSecurity({"yan", "wy"})
    @YanRequestMapping("/index1")
    public String index1(String name) {
        System.out.println("------DemoController------index--1------");
        return demoService.getName(name);
    }


}
